﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace calendar
{
public abstract class AbstractView : IView
{

    public int getID()
    {
        return m_id;
    }

    public string getName()
    {
        return m_name;
    }

    public AbstractView(ProjectFile parent)
    {
        m_parent = parent;
    }

    public ViewType getType()
    {
        return (m_type);
    }

    public String getTableName()
    {
        return (m_tableName);
    }

    public Table getTable()
    {
        return (m_parent.getTaskTableByName(m_tableName));
    }

    public override String ToString()
    {
        return ("[View id=" + m_id + " type=" + m_type + " name=" + m_name + (m_tableName == null ? "" : " table=" + m_tableName) + "]");
    }

    protected ProjectFile m_parent;
    protected int m_id;
    protected String m_name;
    protected ViewType m_type;
    protected String m_tableName;
}
}
